Bug 601512 - Remove unnecessary check in GtkTreeModelFilter
authorAlberto Garcia <agarcia@igalia.com>
Wed, 11 Nov 2009 11:14:16 +0000 (12:14 +0100)
committerKristian Rietveld <kris@gtk.org>
Sun, 15 Nov 2009 12:42:36 +0000 (13:42 +0100)
gtk_tree_model_filter_set_visible_func() is checking for
priv->visible_func, but that is always going to be NULL since there's
no way to call this function twice.

Besides that the code itself is wrong, since it tries to call
priv->visible_destroy without making sure that it's not NULL

gtk/gtktreemodelfilter.c

index 074a7a4fa1f5bfae59d51cb8f373f9f59fc1feea..a3398e602d01d2e0e8bd18d925a39188bf13ead2 100644 (file)
@@ -3058,14 +3058,6 @@ gtk_tree_model_filter_set_visible_func (GtkTreeModelFilter            *filter,
   g_return_if_fail (func != NULL);
   g_return_if_fail (filter->priv->visible_method_set == FALSE);
 
-  if (filter->priv->visible_func)
-    {
-      GDestroyNotify d = filter->priv->visible_destroy;
-
-      filter->priv->visible_destroy = NULL;
-      d (filter->priv->visible_data);
-    }
-
   filter->priv->visible_func = func;
   filter->priv->visible_data = data;
   filter->priv->visible_destroy = destroy;